package com.yjd.comm.enums;

/**
 * 还款报表状态
 * Created by yangchangyan on 2017/8/16.
 */
public enum RepaymentReportStatus {

    PERIORD_NONE_CLEAN(0, "当期未还清"),
    PERIORD_CLEAN(1, "当期已还清"),
    ALL_CLEAN(2, "订单已结清"),
    OVERDUE(4, "已逾期"),

    // 此状态不属于还款报表状态，重复定义是为了便于理解，避免与PERIORD_CLEAN定义重复， see StagesStatusEnum.APPLY_SUCCESS
    APPLY_SUCCESS(-1, "订单受理中"),
    MERCHANT_REFUSAL(-3, "商户拒绝"),
    PAYMENT_INPROGRESS(6, "待支付"),
    ORDER_INVALID(7, "订单已失效"),
    ORDER_PAYMENTING(8, "支付中")
    ;

    private int code;
    private String label;

    public static RepaymentReportStatus parse(int code) {
        for (RepaymentReportStatus v : RepaymentReportStatus.values()) {
            if (v.getCode() == code) {
                return v;
            }
        }
        return null;
    }

    private RepaymentReportStatus(int code, String label) {
        this.code = code;
        this.label = label;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
}
